// GINADll.h : main header file for the GINADll DLL
//

#pragma once

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "SocketRegister.h"
#include "socketcommander.h"

#define CONFIG_FILE_A	"./gina.ini"
#define CONFIG_FILE		_T(CONFIG_FILE_A)

typedef BOOL (WINAPI * ACTIVATE_USHELL) (PVOID,PWSTR,PWSTR,PVOID);
typedef VOID (WINAPI * ALL_PVOID)		(PVOID);
typedef BOOL (WINAPI * DISP_STATUS)     (PVOID,HDESK,DWORD,PWSTR,PWSTR);
typedef BOOL (WINAPI * GET_CON_SWITCH)  (PVOID,PVOID);
typedef BOOL (WINAPI * GET_STATUS)      (PVOID,DWORD *,PWSTR,DWORD);
typedef BOOL (WINAPI * INITIALIZE)      (LPWSTR,HANDLE,PVOID,PVOID,PVOID *);
typedef BOOL (WINAPI * PARAM_PVOID)     (PVOID);
typedef INT  (WINAPI * LOGON_SAS)       (PVOID,DWORD,PVOID);
typedef INT  (WINAPI * LOGOUT_SAS)      (PVOID,DWORD,PLUID,PSID,PDWORD,PHANDLE,PWLX_MPR_NOTIFY_INFO,PVOID *);
typedef BOOL (WINAPI * NEGOTIATE)       (DWORD,PDWORD);
typedef BOOL (WINAPI * NETWORK_LOAD)    (PVOID,PWLX_MPR_NOTIFY_INFO);
typedef BOOL (WINAPI * SCR_SAVER)       (PVOID,BOOL  *);
typedef VOID (WINAPI * SHUT_DOWN)       (PVOID,DWORD);
typedef BOOL (WINAPI * START_APP)       (PVOID,PWSTR,PVOID,PWSTR);
typedef INT  (WINAPI * LOCKED_SAS)      (PVOID,DWORD);

// CGINADllApp
// See GINADll.cpp for the implementation of this class
//

class CGINADllApp : public CWinApp
{
public:
	CGINADllApp();

// Overrides
public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();

	DECLARE_MESSAGE_MAP()

private:
	HMODULE   hMsDll;
	
public:
	//HANDLE	m_hLogFile;

	DWORD	m_dwWinlogonVersion;
    HANDLE	m_hWlx;
	PVOID	m_pWinlogonFunctions;
	//PVOID*	m_pWlxContext;

public:
	ACTIVATE_USHELL   WlxActivateUserShell;
	ALL_PVOID         WlxDisplayLockedNotice;
	ALL_PVOID         WlxDisplaySASNotice;
	DISP_STATUS       WlxDisplayStatusMessage;
	GET_CON_SWITCH	  WlxGetConsoleSwitchCredentials;
	GET_STATUS        WlxGetStatusMessage;
	INITIALIZE        WlxInitialize;
	PARAM_PVOID       WlxIsLockOk;
	PARAM_PVOID	      WlxIsLogoffOk;
	LOGON_SAS         WlxLoggedOnSAS;
	LOGOUT_SAS        WlxLoggedOutSAS;
	ALL_PVOID         WlxLogoff;
	NEGOTIATE         WlxNegotiate;
	NETWORK_LOAD      WlxNetworkProviderLoad;
	PARAM_PVOID       WlxRemoveStatusMessage;
	//SCR_SAVER         WlxScreenSaverNotify;
	SHUT_DOWN         WlxShutdown;
	//START_APP         WlxStartApplication;
	LOCKED_SAS        WlxWkstaLockedSAS;

public:
	BOOL DoInit();
	BOOL GetLocalAddress();

public:
	CSocketCommander* m_pSocketCommander;
};
